"use strict";
import axios from 'axios';

class Expense {

  static getFeeType() {
    /*var list = [{
      id: 1,
      pid: null,
      name: '差旅类',
      seq: 1
    }, {
      id: 2,
      pid: null,
      name: '办公类',
      seq: 2
    }, {
      id: 3,
      pid: 1,
      name: '交通费',
      seq: null,
    }, {
      id: 4,
      pid: 1,
      name: '住宿费',
      seq: 1,
    }, {
      id: 5,
      pid: 2,
      name: '采购费',
      seq: 2,
    }, {
      id: 7,
      pid: 2,
      name: '餐补费',
      seq: 1,
    }, {
      id: 6,
      pid: -1111,
      name: '其他',
      seq: 10,
    }];
    return Promise.resolve(list);*/
    return axios.get('expense/feeType/getCategory.json');
  }

  static addCategory(data){
    //return Promise.resolve({code:'0',data:{id:111111}});
    return axios.post('expense/feeType/addFeeType.json', data);
  }

  static deleteCategory(id){
    return axios.post('expense/feeType/deleteFeeType.json', {id});
  }

  static updateCategory(data){
    return axios.post('expense/feeType/updateFeeType.json', data);
  }
}
export default Expense;
